USE RapPhim
GO

begin tran
SET TRAN ISOLATION LEVEL REPEATABLE READ
	declare @tiLeGiam float
	set @tiLeGiam = (select TiLeGiam from KHUYENMAI where MaKhuyenMai = 1)
	print 'Ti le giam ban dau:'
	print @tiLeGiam
	waitfor delay '0:0:5'

	declare @giaVe float
	set @giaVe = (select GiaVe from LOAIVE where MaLoaiVe = 1)

	declare @tongTien float
	set @tongTien = @giaVe - @giaVe * @tiLeGiam / 100
	set @tiLeGiam = (select TiLeGiam from KHUYENMAI where MaKhuyenMai = 1)
	print 'Ti le giam luc tinh tien:'
	print @tiLeGiam

	print 'Tong tien:'
	print @tongTien
commit